package com.sumainfor.pc.gmio.controller.secretary;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.common.utlis.Pager;
import com.sumainfor.pc.gmio.service.HoEleMeterService;
import com.sumainfor.pc.gmio.service.SeEleMeterExtService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @author Meng
 * @ClassName SeEleMeterExtController
 * @date 2019/11/21 18:40
 * @description: TODO
 */
@Controller
@RequestMapping("/SeEleMeterExt")
public class SeEleMeterExtController {

    @Autowired
    SeEleMeterExtService seEleMeterExtService;

    @Autowired
    HoEleMeterService hoEleMeterService;

    /**
     * 查询房源上一次的抄表数(根据角色划分)
     * @param params
     * @return
     */
    @ResponseBody
    @PostMapping("/getHouInfoEle")
    public JsonResult getHouInfoEle(@RequestBody Map<String,Object> params){
        return hoEleMeterService.getHouInfoEle(params);
    }

    /**
     * 管家抄表查询需要抄表的房源信息
     * @param params
     * @param pager
     * @return
     */
    @ResponseBody
    @PostMapping("/getEleMeterNum")
    public JsonResult getEleMeterNum(@RequestBody Map<String,Object> params, Pager pager){
        return seEleMeterExtService.getEleMeterNum(params,pager);
    }

    /**
     * 秘书抄电的房源
     * @param params
     * @param pager
     * @return
     */
    @ResponseBody
    @PostMapping("/getEleSecretary")
    public JsonResult getEleSecretary(@RequestBody Map<String,Object> params, Pager pager){
        return seEleMeterExtService.getEleSecretary(params,pager);
    }

    /**
     * 管家记录抄表数
     */
    @ResponseBody
    @PostMapping("/getEleBrowse")
    public JsonResult getEleBrowse(@RequestBody Map<String,Object> params){
       return seEleMeterExtService.getEleBrowse(params);
    }



    /**
     * 秘书记录抄电表数
     */
    @ResponseBody
    @PostMapping("/addEleClerk")
    public JsonResult addEleClerk(@RequestBody Map<String,Object> params){
        return seEleMeterExtService.addEleClerk(params);
    }


    /**
     * 管家退租查询上次抄表数
     */
    @ResponseBody
    @PostMapping("/getLastEleLease")
    public JsonResult getLastEleLease(@RequestBody Map<String,Object> params){
        return seEleMeterExtService.getLastEleLease(params);
    }



}
